﻿@model Models.PrivateMessage

@{
    ViewBag.Title = "Send Pm";
}

<h2>Send Pm</h2>

@if(ViewBag.Message != null)
{
    @ViewBag.Message
}
else
{
    using (Html.BeginForm())
    {
        @Html.ValidationSummary()
        <table id="table_admin">
            <tr>
                <td colspan="2">Send message to @ViewBag.ReceiverLogin</td>
            </tr>
            <tr>
                <td>
                    Title
                </td>
                <td>
                    @Html.TextBoxFor(x => x.Title)
                </td>
            </tr>
            <tr>
                <td>
                    Text
                </td>
                <td>
                    @Html.TextAreaFor(x => x.Text)
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    @Html.HiddenFor(x => x.Sender.Login, Model.Sender.Login)
                    @Html.HiddenFor(x => x.Sender.Id, Model.Sender.Id)
                    @Html.HiddenFor(x => x.Sender.Name, Model.Sender.Name)
                    @Html.HiddenFor(x => x.Sender.Email, Model.Sender.Email)
                    @Html.HiddenFor(x => x.Sender.Pwd, Model.Sender.Pwd)
                    @Html.HiddenFor(x => x.Sender.Role, Model.Sender.Role)
                    

                    @Html.HiddenFor(x => x.Receiver.Login, Model.Receiver.Login)
                    @Html.HiddenFor(x => x.Receiver.Id, Model.Receiver.Id)
                    @Html.HiddenFor(x => x.Receiver.Name, Model.Receiver.Name)
                    @Html.HiddenFor(x => x.Receiver.Email, Model.Receiver.Email)
                    @Html.HiddenFor(x => x.Receiver.Pwd, Model.Receiver.Pwd)
                    @Html.HiddenFor(x => x.Receiver.Role, Model.Receiver.Role)
                    <input type="submit" name="subSendPm" value="Send"/>
                </td>
            </tr>
        </table>
    }
}